<%@ Language=VBScript %>
<%Option Explicit%>

<!--#include file="../cons.asp"-->
<!--#include file="../../Common/Database.asp"-->

<%
	Dim oConn, sSQL, oRS
	Dim IdCurso
	
	IdCurso = request("IdCurso")
	Set oConn = OpenConnection
	
	sSQL=	"select distinct A.*, MC.idSedeCurso " & _
			"from Alumno A " & _
			"inner join MateriaCurso MC on (MC.idSedeCurso in (" & IdCurso & ")) " & _
			"inner join AlumnoCurso AC on (MC.idMateriaCurso = AC.idMateriaCurso and AC.idAlumno = A.idAlumno) " & _
			"order by Apellido"
	
	Set oRS = oConn.Execute(sSQL)

	response.Write "<select id=""cmb_Alumnos"" style=""font-family: Verdana; font-size: 10px;"">"
	response.Write "<option value=''></option>"
	while not oRS.EOF
		response.Write "<option value='" & oRS("IdAlumno") & "'>"
		response.Write oRS("Apellido") & ", " & oRS("Nombre")
		response.Write "</option>"
		oRS.MoveNext()
	wend
	response.Write "</select>"
%>